Skip to content

Validate pressures before computing pressure ratios in simplified compressor train - #1719

Open
olelod wants to merge 1 commit into
mainfrom
fix/validate-suction-pressure-before-division
Open

Validate pressures before computing pressure ratios in simplified compressor train#1719
olelod wants to merge 1 commit into
mainfrom
fix/validate-suction-pressure-before-division

Conversation

@olelod

@olelod olelod commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

When SUCTION_PRESSURE is set to 0, a RuntimeWarning: divide by zero is emitted before the validation catches the invalid input. This happens because validate_pressures() is called after create_compressor_model(), which internally computes discharge_pressure / suction_pressure.

@olelod
olelod requested a review from a team as a code owner August 13, 2026 13:06
…d train

Move validate_pressures() call before create_compressor_model() to prevent
divide-by-zero warning when suction pressure is zero. The validation error
was already raised, but after the division had already been attempted.
@olelod
olelod force-pushed the fix/validate-suction-pressure-before-division branch from 539b843 to 9acf1ed Compare August 19, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants